<?php //require_once '../view/header.php'; 
      require_once '../../../Components/Config.inc.php'; 
      global $config;
      //die('esto es-> '.$config['emailDeveloper']);
?>
<?php 
    $idOwner=base64_decode($_GET['idOwner']);
    global $config;                  
    $columns='*';
    $table=$config['tableOwner'];  
    //die('esto es-> '.$table);
    $condition="'".$idOwner."'";
    $query="select * from $table where dni_propietario= $condition";
    $objDb=new Class_Db();
    $objDb->selectManager()->connect();
    //die($columns.''.$table.''.$condition);
    //$consult=$objDb->selectManager()->selectAdd($columns, $table, $condition);    
    $consult=$objDb->selectManager()->select($query);
    //die('es'.$consult[0][1]);
?>
<form action="/app_registro_vehiculos/principal.php?controller=Owner&action=modify" method="post">
    <center>
        <fieldset style="width: 250px">                
            <table>
                <tr>
                    <td>DNI</td>
                    <td><input type="text" name="dni" value="<?php echo $consult[0][0]; ?>" readonly required placeholder="DNI" autofocus maxlength="8" onkeypress="onlyNumbers();"/></td>
                </tr>
                <tr>
                    <td>APELLIDOS</td>
                    <td><input type="text" name="apellidos" value="<?php echo $consult[0][1]; ?>" required placeholder="APELLIDOS" onkeypress="onlyLetters();" /></td>
                </tr>
                <tr>
                    <td>NOMBRES</td>
                    <td><input type="text" name="nombres" value="<?php echo $consult[0][2]; ?>" required placeholder="NOMBRES" onkeypress="onlyLetters();" /></td>
                </tr>
                <tr>
                    <td>SEXO</td>
                    <td>
                        <select  name="sexo" >
                            <?php if($consult[0][3]=='M'){?>
                            <option value="M" selected>Masculino</option>
                            <option value="F">Femenino</option>              
                            <?php }else{?>
                            <option value="M" >Masculino</option>
                            <option value="F" selected>Femenino</option>              
                            <?php }?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>FECHA DE NACIMIENTO</td>
                    <td><input type="date" name="fechaNacimiento" value="<?php echo $consult[0][4]; ?>" required placeholder="FECHA DE NACIMIENTO" /></td>
                </tr>
                <tr>
                    <td>DIRECCION</td>
                    <td><input type="text" name="direccion" value="<?php echo $consult[0][5]; ?>" required placeholder="DIRECCION" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" value="Guardar"  />
                    </td>
                </tr>
            </table>                
        </fieldset>             
    </center>
 </form>
<center>
   <!-- <div style="text-align: center">
        <?php include_once '../view/botonInicio.php'; ?>
    </div>-->
</center>